package com.test;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class T {
	public static void main(String[] args) throws Exception {  
		  SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMdd");
		  /*String str="20110823";
		  Date dt=sdf.parse(str);*/
		  Calendar rightNow = Calendar.getInstance();
		  rightNow.setTime(new Date());
		  rightNow.add(Calendar.YEAR,3);//日期减1年
		 // rightNow.add(Calendar.MONTH,3);//日期加3个月
		  //rightNow.add(Calendar.DAY_OF_YEAR,10);//日期加10天
		  Date dt1=rightNow.getTime();
		  String reStr = sdf.format(dt1);
		  System.out.println(reStr);
		 }
}
